﻿using System;
using System.Web.UI;
using TierApplication;

public partial class ForeProgram_ModifyPassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void imgSubit_Click(object sender, ImageClickEventArgs e)
    {
        T_ACCOUNT account = new T_ACCOUNT();
        if (account.CheckAccout(Security.GetAccountId(), txtoldPassword.Text))
        {
            if (account.ModifyPassword(Security.GetAccountId(), txtnewPassword.Text))
            {
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToLongTimeString(), "<script>alert('修改密码成功！');</script>");
            }
            else
            {
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToLongTimeString(), "<script>alert('修改失败成功！');</script>");
            }
        }
        else
        {
            this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToLongTimeString(), "<script>alert('旧密码有误！');</script>");
        }
    }
}